<?php
// +----------------------------------------------------------------------
// | 麦沃德科技赋能开发者，助力中小企业发展
// +----------------------------------------------------------------------
// | Copyright (c) 2017～2024  www.wdadmin.cn    All rights reserved.
// +----------------------------------------------------------------------
// | Wdadmin系统产品软件并不是自由软件，不加密，并不代表开源，未经许可不可自由转售和商用
// +----------------------------------------------------------------------
// | Author: MY WORLD Team <bd@maiwd.cn>   www.wdadmin.cn
// +----------------------------------------------------------------------
/**
 * Class Config
 * Desc  系统设置Model
 * Create on 2024/10/29 14:01
 * Create by wangyafang
 */

namespace app\api\model\wddj;


use think\Model;

class Config extends Model
{
// 表名
    protected $name = 'wddj_config';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'subscribe_msg_tpl_ids',
    ];

    public function getSubscribeMsgTplIdsAttr($value, $data)
    {
        $row = self::where('id',1)->find();

        return array(
            'applet_passenger_cancellation_order_notice'=>$row['applet_passenger_cancellation_order_notice'],
            'applet_audit_results_notice'=>$row['applet_audit_results_notice'],
            'applet_driver_cancellation_order_notice'=>$row['applet_driver_cancellation_order_notice'],
            'applet_driver_in_position_reminder'=>$row['applet_driver_in_position_reminder'],
            'applet_driver_acceptance_notice'=>$row['applet_driver_acceptance_notice'],
        );
    }
}



 